export function debounce(fn, delay = 300) {
    var timer = null
    return function() {
        var arg = arguments
        var that = this
        clearTimeout(timer)
        timer = setTimeout(() => {
            fn.apply(that, arg)
        }, delay)
    }
}